//package com.wudl.flink.stream.sink
//
//import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment
//import org.apache.flink.streaming.connectors.kafka.internal.FlinkKafkaProducer
//import org.apache.flink.streaming.util.serialization.SimpleStringSchema
//
//object KafkaSinkString {
//  def main(args: Array[String]): Unit = {
//
//    //1. 获取上下文的环境
//    val env:StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment
//    //2.设置并行度
//    env.setParallelism(1)
//    //3、导入隐式转换
//    import org.apache.flink.streaming.api.scala._
//    // 获取string
//    val stream:DataStream[String] = env.socketTextStream("node01.com",8888)
//    // 计算
//    val world:DataStream[String] = stream.flatMap(_.split(" "))
//
//    // 把单词写入到kafka 中
//    world.addSink(new FlinkKafkaProducer[String]("node01.com:6667","flink_topic",new SimpleStringSchema()))
//    env.execute("kafkasink")
//
//
//  }
//}
